const router = require('koa-router')()

// get 传参
router.get('/news', async (ctx, next) => {
    const query = ctx.query
    ctx.body = `新闻: id=${query.id},hard_id:${query.hard_id}`
    console.log(ctx.query)
})

// 动态路由
router.get('/dynamics/:id/hard/:hard_id', async (ctx, next) => {
    const query = ctx.params
    ctx.body = `动态: id=${query.id},hard_id:${query.hard_id}`
    console.log(query)
})

module.exports = router.routes()
